package com.lapula.crazyface.entity;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.PointF;

import com.lapula.crazyface.R;
import com.lapula.crazyface.entity.Emotion.ExpressionItem;
import com.lapula.crazyface.entity.Emotion.OffsetRatio;
import com.lapula.crazyface.util.ImageUtils;

public class YunEmotion extends Emotion {

	private final String expressionFolder = "expression/yun";
	
	public YunEmotion(Context context) {
		super(context);
	}

	@Override
	protected void init() {
		List<Bitmap> head = new ArrayList<Bitmap>();
		head.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "head_01.png"));
		head.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "head_02.png"));
		head.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "head_03.png"));
		head.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "head_04.png"));
		head.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "head_05.png"));
		head.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "head_06.png"));
		OffsetRatio headOffset = new OffsetRatio(-0.5f, -2.0f);
		ExpressionItem headItem = new ExpressionItem(head, headOffset, BASED_POINT_EYE_MIDDLE);
		expressioItems.add(headItem);

		List<Bitmap> leftEyes = new ArrayList<Bitmap>();
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_01.png"));
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_02.png"));
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_03.png"));
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_04.png"));
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_05.png"));
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_06.png"));
		OffsetRatio leftOffset = new OffsetRatio(-0.5f, -0.5f);
		ExpressionItem leftItem = new ExpressionItem(leftEyes, leftOffset, BASED_POINT_LEFT_EYE);
		expressioItems.add(leftItem);
		
		List<Bitmap> rightEyes = new ArrayList<Bitmap>();
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_01.png"));
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_02.png"));
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_03.png"));
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_04.png"));
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_05.png"));
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "eye_06.png"));
		OffsetRatio rightOffset = new OffsetRatio(-0.5f, -0.5f);
		ExpressionItem rightItem = new ExpressionItem(rightEyes, rightOffset, BASED_POINT_RIGHT_EYE);
		expressioItems.add(rightItem);
	}
}
